<%@ page language="java" pageEncoding="utf-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    <title>修改纳税人基本信息</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="${ctx}/css/ui.datepicker.css" rel="stylesheet" type="text/css" media="screen" charset="utf-8" />
	<script src="${ctx}/js/table.js" type="text/javascript" language="javascript"></script>
	<script src="${ctx}/js/jquery-1.5.2.js" type="text/javascript" charset="utf-8"></script>
	<script src="${ctx}/js/ui.datepicker.js" type="text/javascript" charset="utf-8"></script>	
	<script src="${ctx}/js/ui.datepicker-zh-CN.js" type="text/javascript" charset="utf-8"></script>	
	<script src="${ctx}/js/help.js" type="text/javascript" ></script>
<script language="javascript" type="text/javascript">
function validate()
{    var k=document.form1.p_id.value;
   document.getElementById("p_sfznumber").value=k
     if(document.getElementById("p_id").value==""){
     alert("纳税人识别码  不能为空，请输入");
     return false;}
   if(document.getElementById("p_id").value.length!=18){
	     alert("纳税人识别码为18位数字");
	     return false;}
     if(document.getElementById("p_sfznumber").value==""){
     alert("纳税人身份证号 不能为空，请输入");
     return false;}
     if(document.getElementById("p_name").value==""){
     alert("纳税人姓名 不能为空，请输入");
     return false;}
     if(document.getElementById("p_sex").value==""){
     alert("纳税人性别 不能为空，请输入");
     return false;}
	   if(document.getElementById("p_identityLicensesType").value==""){
     alert("请选择身份证类型");
     return false;}
	  if(document.getElementById("p_nationality").value==""){
     alert("纳税人国籍 不能为空，请输入");
     return false;}
     if(document.getElementById("p_familyadd").value==""){
     alert("纳税人家庭住址 不能为空，请输入");
     return false;}
     if(document.getElementById("p_position").value==""){
     alert("任职 不能为空，请输入");
     return false;}
     if(document.getElementById("p_workspace").value==""){
     alert("单位名称 不能为空，请输入");
     return false;}
     if(document.getElementById("p_workadd").value==""){
     alert("单位地址 不能为空，请输入");
     return false;}
     if(document.getElementById("p_callnumber").value==""){
     alert("联系方式 不能为空，请输入");
     return false;}
	 return true;
 }
function checkByNumber(){
	if(document.getElementById("p_id").value==""){
     alert("纳税人识别码  不能为空，请输入");
     return false;
     }
   if(document.getElementById("p_id").value.length!=18){
	     alert("纳税人识别码为18位数字");
	     return false;
	}
	$("#p_sfznumber").val($("#p_id").val());
    var param = {"cardno":$("#p_id").attr("value")};  
    $.ajax({   
        url:"${ctx}/taxmanage/tmPersonInfo_check.action",   
        type:"post",   
        data:param,   
        dataType:"json",   
        success:function(data){ 
			 alert(data);
                }    
            }); 
 return false; 
}
function isMobile(p_callnumber)
{
var s =document.getElementById('p_callnumber').value; 
var reg0 = /^13\d{5,9}$/;
var reg1 = /^153\d{4,8}$/;
var reg2 = /^159\d{4,8}$/;
var reg3 = /^0\d{10,11}$/;
var my = false;
if (reg0.test(s))my=true;
if (reg1.test(s))my=true;
if (reg2.test(s))my=true;
if (reg3.test(s))my=true;
    if(s!="")
    {
        if (!my)
        {
           alert('请输入正确的手机号码');
           p_callnumber.value="";
           p_callnumber.focus();
        }
    }
}

</script>
</head>
  
  <body>
  <div id="content">
  <table width="1070" border="0" cellspacing="0">
  <tr>
    <td>
	<form id="form1" name="form1" action="${ctx}/manage/mperson_update.action?entity.id=${entity.id}" method="post" onSubmit="return validate();">
	
	<fieldset>
	<legend></legend>
	<legend></legend>
	<legend></legend>
	<div align="center">
	  <legend>修改纳税人基本资料信息</legend>
	  <p>&nbsp;</p>
	</div>
	</fieldset>
	  <table width="822" border="0" align="center" style="font-size:13px; color:#333333">
  <tr>
    <td width="152" height="34" align="right">纳税人识别码：</td>
    <td colspan="2"><input name="entity.pcode" type="hidden"  id="p_id"    style="width:120px" value="${entity.pcode}" size="30">
    <input name="entity.pcode"type="text"  id="p_id"  disabled  style="width:120px" value="${entity.pcode}" size="30"></td>
    <td width="154" align="right">纳税人姓名：</td>
    <td width="272"><input name="entity.taxplayer" type="hidden"  id="p_name"  style="width:70px;" value="${entity.taxplayer}" size="30">
    <input name="entity.taxplayer"type="text" disabled id="p_name"  style="width:70px;" value="${entity.taxplayer}" size="30"></td>
  </tr>
  <tr>
    <td height="35" align="right">身份证类型：</td>
    <td colspan="2"><s:select list="{'居民身份证','临时身份证'}" name="entity.idcard" id="p_identityLicensesType"  theme="simple"></s:select></td>
    <td align="right">身份证号：</td>
    <td><input  style="width:120px;"type="hidden"  name="entity.cardno"  id="p_sfznumber">
      <input name="text" type="text" disabled style=" width:120px" value="系统自动判别"></td>
  </tr>
  <tr>
    <td height="33" align="right">性别：</td>
    <td colspan="2"><s:select list="{'男','女'}" name="entity.gender" id="p_sex"  theme="simple"></s:select></td>
    <td align="right">国籍：</td>
    <td><input name="entity.nationality" type="text" id="p_nationality" style="width:80px;" value="${entity.nationality}"></td>
  </tr>
  <tr>
    <td height="36" align="right">单位名称：</td>
    <td colspan="2"><input name="entity.orgname"type="text" id="p_workspace"  style=" width:130px;" value="${entity.orgname}"></td>
    <td align="right">单位住址：</td>
    <td><input name="entity.orgaddress"type="text" id="p_workadd"  style="width:130px;" value="${entity.orgaddress}"></td>
  </tr>
  <tr>
    <td height="38" align="right">家庭住址：</td>
    <td colspan="2"><input name="entity.address"type="text" id="p_familyadd"  style="width:130px;" value="${entity.address}"></td>
    <td align="right">联系方式(手机)：</td>
    <td><input name="entity.phone" type="text" id="p_callnumber" style=" width:100px;" onChange="isMobile(p_callnumber)" value="${entity.phone}"></td>
  </tr>
  <tr>
    <td height="36" align="right">任职：</td>
    <td colspan="2"><input name="entity.position" type="text" id="p_position" style="width:80px;" value="${entity.position}"></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td height="36" align="right">&nbsp;</td>
    <td width="194" align="right"><label>
      <input type="submit" name="Submit" value="提交">
    </label></td>
    <td width="28" align="left">&nbsp;</td>
    <td><label>
      <input type="reset" name="Submit2" value="重置">
    </label></td>
    <td>&nbsp;</td>
  </tr>
</table>

    </form>
	</td>
  </tr>
</table>
  </div>
  

</div>
  </body>
</html>
